#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
    bool findNumberIn2DArray(vector<vector<int>>& matrix, int target) {
        if(matrix.empty())
            return false;
        int n = matrix.size();      //行数
        int m = matrix[0].size();   //列数
        for(int i=0 ; i<n ; i++){
            for(int j=m-1; j>=0; j--){
                if(matrix[i][j] == target)
                    return true;
                else if(matrix[i][j] < target)
                    break;
                else continue;
            }
        }
        return false;
    }
};